import request from '@/utils/request'

// api地址
const api = {
	recommends: '/mxty/MemberCard/recommends',
	list      : '/mxty/MemberCard/getlist',
	detail    : '/mxty/MemberCard/detail',
	buy: '/mxty/MemberCard/buy',
	purchased: '/mxty/MemberCard/purchased',
	checkCard: '/mxty/MemberCard/checkCard',
	useCard: '/mxty/MemberCard/useCard',
	getCodeToken: '/mxty/MemberCard/getCodeToken',
}

// 获取推荐的会员卡
export const recommends = (param) => {
	return request.get(api.recommends, param)
}

// 获取所有会员卡列表
export const list = (param) => {
	return request.get(api.list, param)
}

// 获取指定会员卡的详情
export const detail = (param) => {
	return request.get(api.detail, param)
}

// 购买会员卡
export const buy = (param) => {
	return request.get(api.buy, param)
}

// 获取用户购买的所有会员卡
export const purchased = (param) => {
	return request.get(api.purchased, param)
}

// 工作人员扫码验证会员卡信息
export const checkCard = (param) => {
	return request.get(api.checkCard, param)
}

// 工作人员使用会员卡
export const useCard = (param) => {
	return request.get(api.useCard, param)
}

// 获取二维码token
export const getCodeToken = (param) => {
	return request.get(api.getCodeToken, param)
}